package com.novax.ex.activity.provider.service;


import com.novax.ex.activity.infrastructure.entity.TaskTemplate;
import com.novax.ex.activity.infrastructure.mapper.TaskTemplateMapper;

import com.novax.ex.common.base.BaseMapper;
import com.novax.ex.common.base.BaseService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import jakarta.annotation.Resource;
import java.util.List;



/**
 * @Description 新手任务模板 service
 * @Author ChenXi
 * @Date 2023/06/20/15:43
 */


@Service
public class TaskTemplateService extends BaseService {

    @Resource
    private TaskTemplateMapper taskTemplateMapper;

    @Override
    protected BaseMapper getBaseMapper() {
        return taskTemplateMapper;
    }

    /**
     * @Description: 查询所有任务模板
     * @Author: ChenXi
     * @Date:  2023/6/25 16:53
     * @param
     * @return: java.util.List<com.novax.ex.activity.infrastructure.entity.TaskTemplate>
     **/
    public List<TaskTemplate> queryAll() {
        return taskTemplateMapper.queryAll();
    }


    /**
     * @Description: 修改h5URL
     * @Author: ChenXi
     * @Date:  2023/7/4 17:06
     * @param taskTemplate
     * @return: int
     **/
    @Transactional(rollbackFor = Exception.class)
    public boolean updateH5Url(TaskTemplate taskTemplate){
        return taskTemplateMapper.updateH5Url(taskTemplate) > 0;
    };

}
